home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / util / gnu / xpdf-0.8-src.lha / xpdf-0.8-src / aclocal.m4 next >
M4 Source File  |  1998-11-28  |  9KB  |  293 lines

  1. dnl aclocal.m4 generated automatically by aclocal 1.3
  2.  
  3. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  4. dnl This Makefile.in is free software; the Free Software Foundation
  5. dnl gives unlimited permission to copy and/or distribute it,
  6. dnl with or without modifications, as long as this notice is preserved.
  7.  
  8. dnl This program is distributed in the hope that it will be useful,
  9. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  10. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  11. dnl PARTICULAR PURPOSE.
  12.  
  13. dnl ----- the following are from:
  14. dnl ----- Steve Robbins <stever@jeff.cs.mcgill.ca>
  15.  
  16. dnl Convenience macros
  17.  
  18. dnl Configure-time switch with default
  19. dnl
  20. dnl Each switch defines an --enable-FOO and --disable-FOO option in
  21. dnl the resulting configure script.
  22. dnl
  23. dnl Usage:
  24. dnl smr_SWITCH(name, description, default, pos-def, neg-def)
  25. dnl
  26. dnl where:
  27. dnl
  28. dnl name    name of switch; generates --enable-name & --disable-name
  29. dnl        options
  30. dnl description    help string is set to this prefixed by "enable" or
  31. dnl        "disable", whichever is the non-default value
  32. dnl default    either "on" or "off"; specifies default if neither
  33. dnl        --enable-name nor --disable-name is specified
  34. dnl pos-def    a symbol to AC_DEFINE if switch is on (optional)
  35. dnl neg-def    a symbol to AC_DEFINE if switch is off (optional)
  36. dnl
  37. AC_DEFUN(smr_SWITCH, [
  38.     AC_MSG_CHECKING(whether to enable $2)
  39.     AC_ARG_ENABLE(
  40.     $1, 
  41.     ifelse($3, on, 
  42.         [  --disable-[$1]    disable [$2]],
  43.         [  --enable-[$1]     enable [$2]]),
  44.     [ if test "$enableval" = yes; then
  45.         AC_MSG_RESULT(yes)
  46.         ifelse($4, , , AC_DEFINE($4))
  47.     else
  48.         AC_MSG_RESULT(no)
  49.         ifelse($5, , , AC_DEFINE($5))
  50.     fi ],
  51.         ifelse($3, on,
  52.        [ AC_MSG_RESULT(yes)
  53.          ifelse($4, , , AC_DEFINE($4)) ],
  54.        [ AC_MSG_RESULT(no) 
  55.         ifelse($5, , , AC_DEFINE($5))]))])
  56.  
  57.  
  58. dnl Allow argument for optional libraries; wraps AC_ARG_WITH, to
  59. dnl provide a "--with-foo-library" option in the configure script, where foo
  60. dnl is presumed to be a library name.  The argument given by the user
  61. dnl (i.e. "bar" in ./configure --with-foo-library=bar) may be one of three
  62. dnl things:
  63. dnl    * boolean (no, yes or blank): whether to use library or not
  64. dnl    * file: assumed to be the name of the library
  65. dnl    * directory: assumed to *contain* the library
  66. dnl
  67. dnl The argument is sanity-checked.  If all is well, two variables are
  68. dnl set: "with_foo" (value is yes, no, or maybe), and "foo_LIBS" (value
  69. dnl is either blank, a file, -lfoo, or '-L/some/dir -lfoo').  The idea
  70. dnl is: the first tells you whether the library is to be used or not 
  71. dnl (or the user didn't specify one way or the other) and the second
  72. dnl to put on the command line for linking with the library.
  73. dnl
  74. dnl Usage:
  75. dnl smr_ARG_WITHLIB(name, libname, description)
  76. dnl
  77. dnl name        name for --with argument ("foo" for libfoo)
  78. dnl libname        (optional) actual name of library, 
  79. dnl            if different from name
  80. dnl description        (optional) used to construct help string
  81. dnl
  82. AC_DEFUN(smr_ARG_WITHLIB, [
  83.  
  84. ifelse($2, , smr_lib=[$1], smr_lib=[$2])
  85.  
  86. AC_ARG_WITH([$1]-library,
  87. ifelse($3, , 
  88. [  --with-$1-library[=PATH]   use $1 library],
  89. [  --with-$1-library[=PATH]   use $1 library ($3)]),
  90. [
  91.     if test "$withval" = yes; then
  92.     with_[$1]=yes
  93.     [$1]_LIBS="-l${smr_lib}"
  94.     elif test "$withval" = no; then
  95.     with_[$1]=no
  96.     [$1]_LIBS=
  97.     else
  98.     with_[$1]=yes
  99.     if test -f "$withval"; then
  100.         [$1]_LIBS=$withval
  101.     elif test -d "$withval"; then
  102.         [$1]_LIBS="-L$withval -l${smr_lib}"
  103.     else
  104.         AC_MSG_ERROR(argument must be boolean, file, or directory)
  105.     fi
  106.     fi
  107. ], [   
  108.     with_[$1]=maybe
  109.     [$1]_LIBS="-l${smr_lib}"
  110. ])])
  111.  
  112.  
  113. dnl Check if the include files for a library are accessible, and 
  114. dnl define the variable "name_CFLAGS" with the proper "-I" flag for
  115. dnl the compiler.  The user has a chance to specify the includes
  116. dnl location, using "--with-foo-includes".
  117. dnl
  118. dnl This should be used *after* smr_ARG_WITHLIB *and* AC_CHECK_LIB are
  119. dnl successful.
  120. dnl
  121. dnl Usage:
  122. dnl smr_ARG_WITHINCLUDES(name, header, extra-flags)
  123. dnl
  124. dnl name        library name, MUST same as used with smr_ARG_WITHLIB
  125. dnl header        a header file required for using the lib
  126. dnl extra-flags        (optional) flags required when compiling the
  127. dnl            header, typically more includes; for ex. X_CFLAGS
  128. dnl
  129. AC_DEFUN(smr_ARG_WITHINCLUDES, [
  130.  
  131. AC_ARG_WITH([$1]-includes,
  132. [  --with-$1-includes=DIR  set directory for $1 headers],
  133. [
  134.     if test -d "$withval"; then
  135.     [$1]_CFLAGS="-I${withval}"
  136.     else
  137.     AC_MSG_ERROR(argument must be a directory)
  138.     fi])
  139.  
  140. dnl This bit of logic comes from autoconf's AC_PROG_CC macro.  We need
  141. dnl to put the given include directory into CPPFLAGS temporarily, but
  142. dnl then restore CPPFLAGS to its old value.
  143. dnl
  144. smr_test_CPPFLAGS="${CPPFLAGS+set}"
  145. smr_save_CPPFLAGS="$CPPFLAGS"
  146. CPPFLAGS="$CPPFLAGS ${[$1]_CFLAGS}"
  147.  
  148.     ifelse($3, , , CPPFLAGS="$CPPFLAGS [$3]")
  149.     AC_CHECK_HEADERS($2)
  150.  
  151. if test "$smr_test_CPPFLAGS" = set; then
  152.     CPPFLAGS=$smr_save_CPPFLAGS
  153. else
  154.     unset CPPFLAGS
  155. fi
  156. ])
  157.  
  158.  
  159. dnl Probe for an optional library.  This macro creates both
  160. dnl --with-foo-library and --with-foo-includes options for the configure
  161. dnl script.  If --with-foo-library is *not* specified, the default is to
  162. dnl probe for the library, and use it if found.
  163. dnl
  164. dnl Usage:
  165. dnl smr_CHECK_LIB(name, libname, desc, func, header, x-libs, x-flags)
  166. dnl
  167. dnl name    name for --with options
  168. dnl libname    (optional) real name of library, if different from
  169. dnl        above
  170. dnl desc    (optional) short descr. of library, for help string
  171. dnl func    function of library, to probe for
  172. dnl header    (optional) header required for using library
  173. dnl x-libs    (optional) extra libraries, if needed to link with lib
  174. dnl x-flags    (optional) extra flags, if needed to include header files
  175. dnl
  176. AC_DEFUN(smr_CHECK_LIB,
  177. [
  178. ifelse($2, , smr_lib=[$1], smr_lib=[$2])
  179. ifelse($5, , , smr_header=[$5])
  180. smr_ARG_WITHLIB($1,$2,$3)
  181. if test "$with_$1" != no; then
  182.     AC_CHECK_LIB($smr_lib, $4, 
  183.     smr_havelib=yes, smr_havelib=no, 
  184.     ifelse($6, , ${$1_LIBS}, [${$1_LIBS} $6]))
  185.     if test "$smr_havelib" = yes -a "$smr_header" != ""; then
  186.     smr_ARG_WITHINCLUDES($1, $smr_header, $7)
  187.     smr_safe=`echo "$smr_header" | sed 'y%./+-%__p_%'`
  188.     if eval "test \"`echo '$ac_cv_header_'$smr_safe`\" != yes"; then
  189.         smr_havelib=no
  190.     fi
  191.     fi
  192.     if test "$smr_havelib" = yes; then
  193.     AC_MSG_RESULT(Using $1 library)
  194.     else
  195.     $1_LIBS=
  196.     $1_CFLAGS=
  197.     if test "$with_$1" = maybe; then
  198.         AC_MSG_RESULT(Not using $1 library)
  199.     else
  200.         AC_MSG_WARN(Requested $1 library not found!)
  201.     fi
  202.     fi
  203. fi])
  204.  
  205.  
  206. # serial 1
  207.  
  208. # @defmac AC_PROG_CC_STDC
  209. # @maindex PROG_CC_STDC
  210. # @ovindex CC
  211. # If the C compiler in not in ANSI C mode by default, try to add an option
  212. # to output variable @code{CC} to make it so.  This macro tries various
  213. # options that select ANSI C on some system or another.  It considers the
  214. # compiler to be in ANSI C mode if it handles function prototypes correctly.
  215. #
  216. # If you use this macro, you should check after calling it whether the C
  217. # compiler has been set to accept ANSI C; if not, the shell variable
  218. # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
  219. # code in ANSI C, you can make an un-ANSIfied copy of it by using the
  220. # program @code{ansi2knr}, which comes with Ghostscript.
  221. # @end defmac
  222.  
  223. AC_DEFUN(AM_PROG_CC_STDC,
  224. [AC_REQUIRE([AC_PROG_CC])
  225. AC_BEFORE([$0], [AC_C_INLINE])
  226. AC_BEFORE([$0], [AC_C_CONST])
  227. dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
  228. dnl a magic option to avoid problems with ANSI preprocessor commands
  229. dnl like #elif.
  230. dnl FIXME: can't do this because then AC_AIX won't work due to a
  231. dnl circular dependency.
  232. dnl AC_BEFORE([$0], [AC_PROG_CPP])
  233. AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
  234. AC_CACHE_VAL(am_cv_prog_cc_stdc,
  235. [am_cv_prog_cc_stdc=no
  236. ac_save_CC="$CC"
  237. # Don't try gcc -ansi; that turns off useful extensions and
  238. # breaks some systems' header files.
  239. # AIX            -qlanglvl=ansi
  240. # Ultrix and OSF/1    -std1
  241. # HP-UX            -Aa -D_HPUX_SOURCE
  242. # SVR4            -Xc -D__EXTENSIONS__
  243. for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
  244. do
  245.   CC="$ac_save_CC $ac_arg"
  246.   AC_TRY_COMPILE(
  247. [#include <stdarg.h>
  248. #include <stdio.h>
  249. #include <sys/types.h>
  250. #include <sys/